JBoss Community Archive (Read Only)

Teiid 8.7

Archetype Template Translator Project

One way to start developing a custom translator is to create a project using the Teiid archetype template. When the project is created from the template, it will contain the essential classes (i.e., ExecutionFactory) and resources for you to begin adding your custom logic. Additionally, the maven dependencies are defined in the pom.xml so that you can begin compiling the classes.

To create your custom translator project, you can run the following from the command line:

mvn archetype:generate                                 \
  -DarchetypeGroupId=org.jboss.teiid.arche-types               \
  -DarchetypeArtifactId=translator-archetype          \
  -DarchetypeVersion=8.6.0               \
  -DgroupId=${groupId}   				\
  -DartifactId=translator-${translator-name}	\
  -Dpackage=org.teiid.translator.${translator-name}    \
  -Dversion=8.7.0.Alpha2-SNAPSHOT    \
  -Dtranslator-name=${translator-name}   

where:

  -DarchetypeGroupId    -  is the group ID for the arche type to use to generate
  -DarchetypeArtifactId -  is the artifact ID for the arche type to use to generate
  -DarchetypeVersion	-  is the version for the arche type to use to generate
  -DgroupId		    -  (user defined) group ID for the new translator project pom.xml
  -DartifactId		-  (user defined) artifact ID for the new translator project pom.xml
  -Dpackage		    -  (user defined) the package structure where the java and resource files will be created
  -Dversion		    -  (user defined) the version for the new translator project pom.xml
  -Dtranslator-name	-  (user defined) the name (type) of the new translator project, used to create the java class names

The following is an example:

mvn archetype:generate                                  \
  -DarchetypeGroupId=org.jboss.teiid.arche-types               \
  -DarchetypeArtifactId=translator-archetype          \
  -DarchetypeVersion=8.6.0   	\
  -DgroupId=org.jboss.teiid.connector  	\
  -DartifactId=translator-myType	\
  -Dpackage=org.teiid.translator.myType    \
  -Dversion=8.7.0.Alpha2-SNAPSHOT	\
  -Dtranslator-name=MyType  

When executed, you will be asked to confirm the properties

Confirm properties configuration:
groupId: org.jboss.teiid.connector
artifactId: translator-myType
version: 8.7.0.Alpha2-SNAPSHOT
package: org.teiid.translator.myType
translator-name: MyType
 Y: : 

type Y (yes) and press enter, and the creation of the translator project will be done

Upon creation, a directory based on the artifactId will be created, that will contain the project. 'cd' into that directory and execute a test build to confirm the project was created correctly:

 mvn clean install

This should build successfully, and now you are ready to start adding your custom code.

JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-13 12:57:18 UTC, last content change 2014-04-16 16:40:37 UTC.